﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CKS2320.Common.Model
{
    public class DataQueryListModel
    {
        /// <summary>
        /// AorB
        /// </summary>
        public string RunType { get; set; }
        /// <summary>
        /// 产品ID
        /// </summary>
        public string PartCode { get; set; }
        /// <summary>
        /// 全长
        /// </summary>
        public string PartLength { get; set; }
        /// <summary>
        /// 产品数据
        /// </summary>
        public string DetectedType { get; set; }
        /// <summary>
        /// 指标
        /// </summary>
        public bool? Indicator { get; set; }
        /// <summary>
        /// 公差带
        /// </summary>
        public bool? ToleranceZone { get; set; }
        /// <summary>
        /// 测量值
        /// </summary>
        public float? DetectedData { get; set; }
        /// <summary>
        /// 测量用时
        /// </summary>
        public string DetectedTime { get; set; }
        /// <summary>
        /// 测量状态
        /// </summary>
        public bool? DetectedResult { get; set; }
        /// <summary>
        /// 图片显示
        /// </summary>
        public string DetectedImage { get; set; }
    }

    public class DataQueryResponse
    {
        public int? totalOK { get; set; } = 0;
        public int? totalNG { get; set; } = 0;
        public List<DataQueryListModel> list { get; set; } = new();
    }
    public class HistoryDataTrendsPackResponse
    {
        public List<HistoryDataTrendsPack> bow { get; set; } = new();
        public List<HistoryDataTrendsPack> camble { get; set; } = new();
        public List<HistoryDataTrendsPack> entireLength { get; set; } = new();
    }
    public class ExportQueryModel
    {
        //已检测
        public int? No { get; set; } = 0;
        //OK
        public string? Bow { get; set; }
        //NG
        public string? BowResult { get; set; }
        public string? PartCode { get; set; }
        /// <summary>
        /// DC 最终电流
        /// </summary>
        public string? Pot { get; set; }
        /// <summary>
        /// DC 设定电压
        /// </summary>
        public string? voltageDC { get; set; }
        /// <summary>
        /// DC 结果
        /// </summary>
        public string? PotResult { get; set; }

        /// <summary>
        /// AC 最终电流
        /// </summary>
        public string? PotAC { get; set; }
        /// <summary>
        /// AC 设定电压
        /// </summary>
        public string? voltageAC { get; set; }
        /// <summary>
        /// AC 结果
        /// </summary>
        public string? PotResultAC { get; set; }
        public string? Camber { get; set; }

        public string? ResultCamber { get; set; }
        public string? TotalLength { get; set; }
        /// <summary>
        /// 背面波间距2
        /// </summary>
        public string? BackScallop2Pitch { get; set; }
        /// <summary>
        /// 背面波直径2
        /// </summary>
        public string? BackScallop2Diameter { get; set; }
        /// <summary>
        /// 背面波间距3
        /// </summary>
        public string? BackScallop3Pitch { get; set; }
        /// <summary>
        /// 背面波直径3
        /// </summary>
        public string? BackScallop3Diameter { get; set; }
        /// <summary>
        /// 正面波间距2
        /// </summary>
        public string? FrontScallop2Pitch { get; set; }
        /// <summary>
        /// 正面波直径2
        /// </summary>
        public string? FrontScallop2Diameter { get; set; }
        /// <summary>
        /// 正面波间距3
        /// </summary>
        public string? FrontScallop3Pitch { get; set; }
        /// <summary>
        /// 正面波直径3
        /// </summary>
        public string? FrontScallop3Diameter { get; set; }
        /// <summary>
        /// 正面厚度7  正面最大值
        /// </summary>
        public string? FrontThickness7 { get; set; }
        /// <summary>
        /// 背面厚度7 正面最小值
        /// </summary>
        public string? BackThickness7 { get; set; }

        /// <summary>
        /// 正面barb到1
        /// </summary>
        public string? SC01 { get; set; }
        /// <summary>
        /// 正面barb到最后
        /// </summary>
        public string? SC02 { get; set; }
        /// <summary>
        /// 背面barb到1
        /// </summary>
        public string? SC03 { get; set; }
        /// <summary>
        /// 背面barb到最后
        /// </summary>
        public string? SC04 { get; set; }

        /// <summary>
        /// 小末端方向检查
        /// </summary>
        public string? SED { get; set; }
        /// <summary>
        /// OP10测试通道
        /// </summary>        
        public string? OP10Passageway {  get; set; }
        /// <summary>
        /// OP20测试通道
        /// </summary>    
        public string? OP20Passageway { get; set; }
        /// <summary>
        /// OP30测试通道
        /// </summary>    
        public string? OP30Passageway { get; set; }
        /// <summary>
        /// OP10测试时间
        /// </summary>
        public string? Op10CreatTime { get; set; }
        /// <summary>
        ///  OP20测试时间
        /// </summary>
        public string? Op20CreatTime { get; set; }
        /// <summary>
        ///  OP30测试时间
        /// </summary>
        public string? Op30CreatTime { get; set; }
        public string? Op20FinalJuge { get; set; }
        public string? Op30FinalJuge { get; set; }
        /// <summary>
        /// 非正面（二维码面）膜厚最大值
        /// </summary>
        public string? NonPositiveMaxThickness { get; set; }
        /// <summary>
        /// 非正面（二维码面）膜厚最大值判定
        /// </summary>
        public string? NonPositiveMaxThicknessJudge { get; set; }
        /// <summary>
        /// 非正面（二维码）最大值单位
        /// </summary>
        public string? NonPositiveMaxThicknessUnit { get; set; } = "mm";
        /// <summary>
        /// 非正面（二维码）膜厚最小值
        /// </summary>
        public string? NonPositiveMiniThickness { get; set; }
        /// <summary>
        /// 非正面（二维码）膜厚最小值判定
        /// </summary>
        public string? NonPositiveMiniThicknessJudge { get; set; }
        /// <summary>
        /// 非正面（二维码）最小值单位
        /// </summary>
        public string? NonPositiveMiniThicknessUnit { get; set; } = "mm";



    }
    public class ExportQueryCount
    {
        public int? No { get; set; }
        //已检测
        public string? DatatimeName { get; set; }
        //OK
        public int? BowCount { get; set; }
        //NG
        public int? BowOK { get; set; }
        public int? BowNG { get; set; }
        public int? hipotCount { get; set; }
        public int? hipotOK { get; set; }
        public int? hipotNG { get; set; }
        public int? CamberCount { get; set; }
        public int? CamberOK { get; set; }
        public int? CamberNG { get; set; }
     



    }

    public class DataQueryResponseNew
    {
        //已检测
        public int? Detected { get; set; } = 0;
        //OK
        public int? OK { get; set; } = 0;
        //NG
        public int? NG { get; set; } = 0;
        public int? ThicknessNG { get; set; } = 0;
        public int? BOWNG { get; set; } = 0;
        public int? camberNG { get; set; } = 0;
        public float? totalRunTime { get; set; } = 0;
        public float? faultTime { get; set; } = 0;
        public float? stopTime { get; set; } = 0;
        public float? holdTime { get; set; } = 0;

        public float? OEE { get; set; } = 0;
        //public int? totalNG { get; set; } = 0;
        //public List<DataQueryListModel> list { get; set; } = new();
        //A数组
        public List<DataQuery> listA { get; set; } = new();
        //B数组
        public List<DataQuery> listB { get; set; } = new();

    }
    public class DataQuery
    {
        //public int? totalOK { get; set; } = 0;
        //public int? totalNG { get; set; } = 0;
        //public List<DataQueryListModel> list { get; set; } = new();
        public string? RunType { get; set; }

        //产品二维码
        public string? PartCode { get; set; }
        //1号检测台ID
        public string? ShapeID { get; set; }
        //BOW
        public string? BOW { get; set; }
        //Hi-pot
        public string? POT { get; set; }
        //2号检测台ID
        public string? VoltagewithstandID { get; set; }
        //3号检测台ID
        public string? ThicknessdetectionID { get; set; }
        //Camber
        public string? Camber { get; set; }
        //总长
        public string? TotalLength { get; set; }
        //C基准-64波距离
        public string? sc01 { get; set; }
        //1波距离
        public string? sc02 { get; set; }
        /// <summary>
        /// 大端距离
        /// </summary>
        public string? sc03 { get; set; }
        //小端距离
        public string? sc04 { get; set; }
        public string? fctmax { get; set; }
        //小端距离
        public string? fctmin { get; set; }
        public string? bctmax { get; set; }
        //小端距离
        public string? bctmin { get; set; }
        //膜厚
        public string? Thickness { get; set; }
        //结果
        public string? Result { get; set; }

    }

    public class ThicknessResponse
    {
        //正面
        public string? DetectedTypeFront { get; set; }
        public string? FrontData { get; set; }
        //背面
        public string? DetectedTypeBack { get; set; }
        public string? BackData { get; set; }
    }
    public class HistoryDataTrendsPack
    {
        /// <summary>
        /// 小时
        /// </summary>
        public string hour { get; set; } = string.Empty;
        /// <summary>
        /// 指标
        /// </summary>
        public string indicator { get; set; } = string.Empty;
        /// <summary>
        /// 数据
        /// </summary>
        public List<float?> data { get; set; } = new();

    }


    public class ExportQueryListModel
    {
        /// <summary>
        /// 产品ID
        /// </summary>
        public string PartCode { get; set; } = string.Empty;
        /// <summary>
        /// IP
        /// </summary>
        public string PLCIP { get; set; } = string.Empty;
        /// <summary>
        /// 检测台
        /// </summary>
        public string StationCode { get; set; } = string.Empty;
        /// <summary>
        /// 检测数据
        /// </summary>
        public float? DetectedData { get; set; }
        /// <summary>
        /// 检测类型
        /// </summary>
        public string DetectedType { get; set; } = string.Empty;
        /// <summary>
        /// A/B件
        /// </summary>
        public string Description { get; set; } = string.Empty;
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreatedTime { get; set; }
    }
}
